package com.thinklib.controller;

import com.thinklib.service.FileUploadService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/api/v1/file/")
public class FileUploadController {

    @Resource
    private FileUploadService fileUploadService;

    @RequestMapping("/upload")
    @Transactional
    public String upload(HttpServletRequest request) {
        String status = fileUploadService.upload(request);
        return status;
    }

}
